package com.guigu.controller.lq.controller;

import com.guigu.controller.lq.pojo.*;
import com.guigu.controller.lq.service.*;
import com.guigu.pojo.Vip;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class LqMakeController {
    @Autowired
    LqMakeService lqMakeService;
    @Autowired
    LqManagementService lqManagementService;
    @Autowired
    LqVipSetvice lqVipSetvice;
    @Autowired
    LqPhysicaljgservice lqPhysicaljgservice;
    @Autowired
    LqPsychologyjgService lqPsychologyjgService;
    @Autowired
    LqJbService lqJbService;
    @RequestMapping("/fl")
    public PageVO<LqMake> findfl(@RequestBody PageVO pageVO){
        PageVO<LqMake> all = lqMakeService.findfl(pageVO.getPage(), pageVO.getNum(), pageVO.getVipname());
        return all;
    }
    @RequestMapping("/gls")
    public List<LqManagement> findgls(){
        List<LqManagement> findgls = lqManagementService.findgls();
        return findgls;
    }
    @RequestMapping("/jb")
    public Vip findjb(@RequestBody Vip lqVip){
        Vip findzb = lqVipSetvice.findzb(lqVip.getVid());
        return findzb;
    }
    @RequestMapping("/tj")
    public List<Vip> findtj(@RequestBody LqVip lqVip){
        List<Vip> findtj = lqVipSetvice.findtj(lqVip.getVipid());
        return findtj;
    }
    @RequestMapping("/tzcx")
    public List<LqPhysicaljg> findtz(@RequestBody LqPhysicaljg lqPhysicaljg){
        List<LqPhysicaljg> findtz = lqPhysicaljgservice.findtz(lqPhysicaljg.getVipid());
        return findtz;
    }
    @RequestMapping("/xlcx")
    public List<LqPsychologyjg> findxl(@RequestBody LqPsychologyjg lqPsychologyjg){
        List<LqPsychologyjg> findxl = lqPsychologyjgService.findxl(lqPsychologyjg.getVipid());
        return findxl;
    }
    @RequestMapping("/jbc")
    public  List<LqJb> fidnjb(){
        List<LqJb> findjb = lqJbService.findjb();
        return findjb ;
    }
    @RequestMapping("/findid")
    public Vip findid(@RequestBody LqMake lqMake){
        LqMake findid = lqMakeService.findid(lqMake.getId());
        if(findid!=null){
        return lqVipSetvice.byid(findid.getVipid());
        }
        return null;
    }
    @RequestMapping("/yyc")
    public LqMake findyy(@RequestBody LqMake lqMake){
        LqMake findyy = lqMakeService.findyy(lqMake.getVipid());
        return findyy;
    }
    @RequestMapping("/uprq")
    public int uprq(@RequestBody LqMake lqMake){
        int uprq = lqMakeService.uprq(lqMake);
        return uprq;
    }

}
